//Symbol 数据类型

//shard.js--------------------------------------

const s = Symbol();
console.log(s); //Symbol()
console.log(typeof s); //symbol

const obj = {};
obj[Symbol("1")] = "123";
obj[Symbol("2")] = "456";
console.log(obj); //{ [Symbol(1)]: '123', [Symbol(2)]: '456' }
console.log(obj[Symbol("1")]); //undefined

const obj1 = {
  [Symbol()]: 1,
};
console.log(obj1);

//创建私有属性
const name = Symbol();
const person = {
  [name]: "lagou",
  say() {
    console.log(this[name]);
  },
};
console.log(person[name]);
person.say();
